package com.crizzbe.storeManage.Controller;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import com.crizzbe.storeManage.entity.Buyer;
import com.crizzbe.storeManage.mapper.BuyerMapper;



/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Crizzbe
 * @since 2021-06-22
 */
@RestController
@CrossOrigin
@RequestMapping("/StoreManage/buyer")
public class BuyerController {
	@Autowired
	private BuyerMapper buyer;
	@GetMapping("/")
	pubic List<Buyer> index() {
		 return buyer.selectList(null);
	 }
	@PostMapping("/add")
	public void add(@RequestBody Buyer parm) {
		buyer.insert(parm);
	}
	@PostMapping("/delete")
	public int deleteData(@RequestBody Buyer parm) {
		return buyer.deleteById(parm.Id);
	}
@PostMapping("/update")
	
	public void update(@RequestBody Buyer form) {
	buyer.updateById(form);
	}

}

